<script lang="ts" setup>
import { ref, onMounted } from "vue";
import { getUserPostApi } from "@/api/user";
import XsItem from "@/components/xs-item.vue";

const userPost = ref<IPost[]>();

const getUserPost = async () => {
  const res = await getUserPostApi();
  userPost.value = res.data;
  console.log(res.data);
};

onMounted(() => {
  getUserPost();
});
</script>

<template>
  <div class="myPost">
    <VanNavBar title="我的帖子" />
    <XsItem v-for="item in userPost" :key="item.id" :data="item" />/>
  </div>
</template>
